package com.lyfx.ly.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lsy
 * @create 2020-07-31-9:43
 */
@Configuration
public class RedissonConfig {

    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient(){
        Config config = new Config();
        //Redis url should start with redis:// or rediss:// (for SSL connection)
        config.useSingleServer().setAddress("redis://39.97.100.107:6379");
        return Redisson.create(config);
    }
}
